# test02_paramiko.py
import paramiko

def rcmds(host, username, password, cmds):
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(host,username=username,password=password)
    data = ssh.exec_command(cmds)
    print(data[1].read().decode())
    print(data[2].read().decode())
    ssh.close()
if __name__ == '__main__':
    rcmds("127.0.0.1","root","1","id root;id hehe")
